home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / mail / mh / updates / MH.6.7.1 < prev    next >
Text File  |  1990-12-13  |  31KB  |  1,082 lines

  1. Prereq: patch.0
  2. *** ../mh-6.7-dist/./Patchlevel    Thu Apr 12 13:31:00 1990
  3. --- ./Patchlevel    Fri Dec 14 09:17:57 1990
  4. ***************
  5. *** 1 ****
  6. ! MH.6.7 patch.0
  7. --- 1 ----
  8. ! MH.6.7 patch.1
  9. *** ../mh-6.7-dist/./uip/replsbr.c    Thu Apr 12 13:29:36 1990
  10. --- ./uip/replsbr.c    Mon Nov  5 11:38:46 1990
  11. ***************
  12. *** 1,6 ****
  13.   /* replsbr.c - routines to help repl along... */
  14.   #ifndef    lint
  15. ! static char ident[] = "@(#)$Id: replsbr.c,v 1.6 90/04/05 14:59:43 sources Exp $";
  16.   #endif    lint
  17.   
  18.   #include "../h/mh.h"
  19. --- 1,6 ----
  20.   /* replsbr.c - routines to help repl along... */
  21.   #ifndef    lint
  22. ! static char ident[] = "@(#)$Id: replsbr.c,v 1.9 90/11/05 11:38:43 mh Exp $";
  23.   #endif    lint
  24.   
  25.   #include "../h/mh.h"
  26. ***************
  27. *** 85,91 ****
  28.       char    *cp;
  29.       int      format_len;
  30.       register char **ap;
  31. -     struct comp **used_buf_fp;
  32.   
  33.       (void) umask( ~ m_gmprot() );
  34.       if ((out = fopen (drft, "w")) == NULL)
  35. --- 85,90 ----
  36. ***************
  37. *** 94,113 ****
  38.       cp = new_fs (form ? form : replcomps, NULLCP, NULLCP);
  39.       format_len = strlen (cp);
  40.       ncomps = fmt_compile (cp, &fmt) + 1;
  41. !     nxtbuf = compbuffers = (char **)calloc((unsigned)ncomps,sizeof(char *));
  42. !     if (nxtbuf == NULL)
  43.       adios (NULLCP, "unable to allocate component buffers");
  44. !     used_buf_fp = used_buf =
  45. !     (struct comp **)calloc((unsigned)(ncomps+1),sizeof(struct comp *));
  46. !     if (used_buf == NULL)
  47.       adios (NULLCP, "unable to allocate component buffer stack");
  48. !     used_buf += ncomps+1; *--used_buf = 0;
  49.       for (i = ncomps; i--; )
  50.       if ((*nxtbuf++ = malloc( SBUFSIZ )) == NULL)
  51.           adios (NULLCP, "unable to allocate component buffer");
  52.   
  53. !     nxtbuf = compbuffers;
  54. !     savecomp = used_buf;
  55.       tmpbuf = *nxtbuf++;
  56.   
  57.       for (ap = addrcomps; *ap; ap++) {
  58. --- 93,113 ----
  59.       cp = new_fs (form ? form : replcomps, NULLCP, NULLCP);
  60.       format_len = strlen (cp);
  61.       ncomps = fmt_compile (cp, &fmt) + 1;
  62. !     if ((nxtbuf = compbuffers = (char **)
  63. !         calloc((unsigned)ncomps,sizeof(char *))) 
  64. !         == (char **)NULL)
  65.       adios (NULLCP, "unable to allocate component buffers");
  66. !     if ((savecomp = used_buf = (struct comp **)
  67. !         calloc((unsigned)(ncomps+1),sizeof(struct comp *)))
  68. !         == (struct comp **)NULL)
  69.       adios (NULLCP, "unable to allocate component buffer stack");
  70. !     savecomp += ncomps + 1;
  71. !     *--savecomp = (struct comp *)0;    /* point at zero'd end minus 1 */
  72.       for (i = ncomps; i--; )
  73.       if ((*nxtbuf++ = malloc( SBUFSIZ )) == NULL)
  74.           adios (NULLCP, "unable to allocate component buffer");
  75.   
  76. !     nxtbuf = compbuffers;        /* point at start */
  77.       tmpbuf = *nxtbuf++;
  78.   
  79.       for (ap = addrcomps; *ap; ap++) {
  80. ***************
  81. *** 232,243 ****
  82.   
  83.       /* return dynamically allocated buffers */
  84.       free (scanl);
  85. !     while ( cptr = *savecomp++ )
  86. !     free (cptr->c_text);
  87. !     for (nxtbuf = compbuffers, i = ncomps; i--; )
  88. !         free (*nxtbuf++);
  89.       free ((char *) compbuffers);
  90. !     free ((char *) used_buf_fp);
  91.   }
  92.   
  93.   /*   */
  94. --- 232,244 ----
  95.   
  96.       /* return dynamically allocated buffers */
  97.       free (scanl);
  98. !     for (nxtbuf = compbuffers, i = ncomps;
  99. !         cptr = *savecomp++; nxtbuf++, i--)
  100. !     free (cptr->c_text);    /* if not nxtbuf, nxtbuf already freed */
  101. !     while ( i-- > 0)
  102. !         free (*nxtbuf++);    /* free unused nxtbufs */
  103.       free ((char *) compbuffers);
  104. !     free ((char *) used_buf);
  105.   }
  106.   
  107.   /*   */
  108. *** ../mh-6.7-dist/./uip/rcvdist.c    Thu Apr 12 13:29:36 1990
  109. --- ./uip/rcvdist.c    Mon Nov  5 13:50:16 1990
  110. ***************
  111. *** 1,6 ****
  112.   /* rcvdist.c - a rcvmail program to distribute messages */
  113.   #ifndef    lint
  114. ! static char ident[] = "@(#)$Id: rcvdist.c,v 1.4 90/04/05 14:59:35 sources Exp $";
  115.   #endif    lint
  116.   
  117.   #include "../h/mh.h"
  118. --- 1,6 ----
  119.   /* rcvdist.c - a rcvmail program to distribute messages */
  120.   #ifndef    lint
  121. ! static char ident[] = "@(#)$Id: rcvdist.c,v 1.6 90/11/05 13:50:14 mh Exp $";
  122.   #endif    lint
  123.   
  124.   #include "../h/mh.h"
  125. ***************
  126. *** 175,181 ****
  127.       char   *cp,
  128.              *scanl,
  129.               name[NAMESZ];
  130. -     struct comp **used_buf_fp;
  131.       register struct comp   *cptr,
  132.                             **savecomp;
  133.       FILE   *out;
  134. --- 175,180 ----
  135. ***************
  136. *** 186,208 ****
  137.       cp = new_fs (form ? form : rcvdistcomps, NULLCP, NULLCP);
  138.       format_len = strlen (cp);
  139.       ncomps = fmt_compile (cp, &fmt) + 1;
  140. !     nxtbuf = compbuffers = (char **) calloc ((unsigned) ncomps,
  141. !         sizeof (char *));
  142. !     if (nxtbuf == NULL)
  143.       adios (NULLCP, "unable to allocate component buffers");
  144. !     used_buf = (struct comp **) calloc ((unsigned) (ncomps + 1),
  145. !                             sizeof (struct comp *));
  146. !     if (used_buf == NULL)
  147.       adios (NULLCP, "unable to allocate component buffer stack");
  148. !     used_buf_fp = used_buf;
  149. !     used_buf += ncomps + 1;
  150. !     *--used_buf = 0;
  151.       for (i = ncomps; i--;)
  152.       if ((*nxtbuf++ = malloc (SBUFSIZ)) == NULL)
  153.           adios (NULLCP, "unable to allocate component buffer");
  154.       nxtbuf = compbuffers;
  155. -     savecomp = used_buf;
  156.       tmpbuf = *nxtbuf++;
  157.   
  158.       for (ap = addrcomps; *ap; ap++) {
  159. --- 185,205 ----
  160.       cp = new_fs (form ? form : rcvdistcomps, NULLCP, NULLCP);
  161.       format_len = strlen (cp);
  162.       ncomps = fmt_compile (cp, &fmt) + 1;
  163. !     if ((nxtbuf = compbuffers = (char **)
  164. !         calloc ((unsigned) ncomps, sizeof (char *)))
  165. !         == (char **)NULL)
  166.       adios (NULLCP, "unable to allocate component buffers");
  167. !     if ((savecomp = used_buf = (struct comp **)
  168. !         calloc ((unsigned) (ncomps + 1), sizeof (struct comp *)))
  169. !         == (struct comp **) NULL)
  170.       adios (NULLCP, "unable to allocate component buffer stack");
  171. !     savecomp += ncomps + 1;
  172. !     *--savecomp = 0;
  173.       for (i = ncomps; i--;)
  174.       if ((*nxtbuf++ = malloc (SBUFSIZ)) == NULL)
  175.           adios (NULLCP, "unable to allocate component buffer");
  176.       nxtbuf = compbuffers;
  177.       tmpbuf = *nxtbuf++;
  178.   
  179.       for (ap = addrcomps; *ap; ap++) {
  180. ***************
  181. *** 277,288 ****
  182.       (void) fclose (out);
  183.   
  184.       free (scanl);
  185. !     while (cptr = *savecomp++)
  186.       free (cptr -> c_text);
  187. !     for (nxtbuf = compbuffers, i = ncomps; i--; )
  188.           free (*nxtbuf++);
  189.       free ((char *) compbuffers);
  190. !     free ((char *) used_buf_fp);
  191.   }
  192.   
  193.   /*   */
  194. --- 274,285 ----
  195.       (void) fclose (out);
  196.   
  197.       free (scanl);
  198. !     for (nxtbuf = compbuffers, i = ncomps; cptr = *savecomp++; nxtbuf++, i--)
  199.       free (cptr -> c_text);
  200. !     while (i-- > 0)
  201.           free (*nxtbuf++);
  202.       free ((char *) compbuffers);
  203. !     free ((char *) used_buf);
  204.   }
  205.   
  206.   /*   */
  207. *** ../mh-6.7-dist/./uip/rmf.c    Thu Apr 12 13:29:37 1990
  208. --- ./uip/rmf.c    Mon Nov  5 12:22:06 1990
  209. ***************
  210. *** 1,6 ****
  211.   /* rmf.c - remove a folder */
  212.   #ifndef    lint
  213. ! static char ident[] = "@(#)$Id: rmf.c,v 2.2 90/04/05 14:57:11 sources Exp $";
  214.   #endif    lint
  215.   
  216.   #include "../h/mh.h"
  217. --- 1,6 ----
  218.   /* rmf.c - remove a folder */
  219.   #ifndef    lint
  220. ! static char ident[] = "@(#)$Id: rmf.c,v 2.3 90/11/05 12:22:03 mh Exp $";
  221.   #endif    lint
  222.   
  223.   #include "../h/mh.h"
  224. ***************
  225. *** 13,19 ****
  226.   #define    INTRSW    0
  227.       "interactive", 0,
  228.   #define    NINTRSW    1
  229. !     "nointerative", 0,
  230.   
  231.   #define    HELPSW    2
  232.       "help", 4,
  233. --- 13,19 ----
  234.   #define    INTRSW    0
  235.       "interactive", 0,
  236.   #define    NINTRSW    1
  237. !     "nointeractive", 0,
  238.   
  239.   #define    HELPSW    2
  240.       "help", 4,
  241. *** ../mh-6.7-dist/./uip/rcvtty.c    Thu Apr 12 13:29:36 1990
  242. --- ./uip/rcvtty.c    Mon Nov  5 13:06:03 1990
  243. ***************
  244. *** 1,6 ****
  245.   /* rcvtty.c - a rcvmail program (a lot like rcvalert) handling IPC ttys */
  246.   #ifndef    lint
  247. ! static char ident[] = "@(#)$Id: rcvtty.c,v 1.5 90/04/05 15:02:11 sources Exp $";
  248.   #endif    lint
  249.   
  250.   #ifndef    BSD42
  251. --- 1,6 ----
  252.   /* rcvtty.c - a rcvmail program (a lot like rcvalert) handling IPC ttys */
  253.   #ifndef    lint
  254. ! static char ident[] = "@(#)$Id: rcvtty.c,v 1.6 90/11/05 13:05:54 mh Exp $";
  255.   #endif    lint
  256.   
  257.   #ifndef    BSD42
  258. ***************
  259. *** 18,24 ****
  260.   
  261.   /*   */
  262.   #define    SCANFMT    \
  263. ! "%2(hour{dtimenow}):%02(min{dtimenow}): %5(size) %<{encrypted}E%>\
  264.   %<(mymbox{from})To:%14(friendly{to})%|%17(friendly{from})%>  \
  265.   %{subject}%<{body}<<%{body}>>%>"
  266.   
  267. --- 18,24 ----
  268.   
  269.   /*   */
  270.   #define    SCANFMT    \
  271. ! "%2(hour{dtimenow}):%02(min{dtimenow}): %<(size)%5(size) %>%<{encrypted}E%>\
  272.   %<(mymbox{from})To:%14(friendly{to})%|%17(friendly{from})%>  \
  273.   %{subject}%<{body}<<%{body}>>%>"
  274.   
  275. *** ../mh-6.7-dist/./uip/dropsbr.c    Thu Apr 12 13:29:27 1990
  276. --- ./uip/dropsbr.c    Mon Nov  5 13:26:59 1990
  277. ***************
  278. *** 1,6 ****
  279.   /* dropsbr.c - write to a mailbox */
  280.   #ifndef    lint
  281. ! static char ident[] = "@(#)$Id: dropsbr.c,v 1.11 90/04/05 15:01:09 sources Exp $";
  282.   #endif    lint
  283.   
  284.   #include <stdio.h>
  285. --- 1,6 ----
  286.   /* dropsbr.c - write to a mailbox */
  287.   #ifndef    lint
  288. ! static char ident[] = "@(#)$Id: dropsbr.c,v 1.12 90/11/05 13:26:50 mh Exp $";
  289.   #endif    lint
  290.   
  291.   #include <stdio.h>
  292. ***************
  293. *** 408,413 ****
  294. --- 408,418 ----
  295.               if (*cp++ == '\n')
  296.                   size++;
  297.           }
  298. +         if (write (md, "\n", 1) != 1) {
  299. +         (void) fclose (fp);
  300. +         return NOTOK;
  301. +         }
  302. +         if (mapping) size += 2;
  303.   
  304.           (void) fclose (fp);
  305.           (void) lseek (fd, 0L, 2);
  306. *** ../mh-6.7-dist/./support/pop/popser.c    Thu Apr 12 13:29:23 1990
  307. --- ./support/pop/popser.c    Fri Nov 16 16:06:38 1990
  308. ***************
  309. *** 1,6 ****
  310.   /* popser.c - the POP service */
  311.   #ifndef    lint
  312. ! static char ident[]="@(#)$Id: popser.c,v 1.13 90/04/09 09:45:18 sources Exp Locker: sources $";
  313.   #endif
  314.   
  315.   #include "../h/mh.h"
  316. --- 1,6 ----
  317.   /* popser.c - the POP service */
  318.   #ifndef    lint
  319. ! static char ident[]="@(#)$Id: popser.c,v 1.16 90/11/16 14:56:38 mh Exp $";
  320.   #endif
  321.   
  322.   #include "../h/mh.h"
  323. ***************
  324. *** 40,48 ****
  325. --- 40,54 ----
  326.   extern char myhost[];
  327.   extern char *myname;
  328.   
  329. + #ifndef    POP2
  330.   static enum state {
  331.       auth1, auth2, trans, update, halt, error
  332.   } mystate;
  333. + #else
  334. + static enum state {
  335. +     auth1, auth2, trans, mbox, item, ack, update, halt, error
  336. + } mystate;
  337. + #endif
  338.   
  339.   
  340.   static int     user (), pass ();
  341. ***************
  342. *** 59,64 ****
  343. --- 65,73 ----
  344.   int    xtnd ();
  345.   #endif    BPOP
  346.   static int     quit ();
  347. + #ifdef    POP2
  348. + static int    helo (), rdp2 (), acks (), ack2 (), fold (), nack ();
  349. + #endif    POP2
  350.   
  351.   static struct vector {
  352.       char   *v_cmd;
  353. ***************
  354. *** 87,95 ****
  355.   #ifdef    BPOP
  356.       "xtnd", 1, 2, xtnd, trans, trans, trans,
  357.   #endif    BPOP
  358.       "quit", 0, 0, quit, trans, halt, halt,
  359.   
  360.       NULL
  361.   };
  362.   
  363. --- 96,121 ----
  364.   #ifdef    BPOP
  365.       "xtnd", 1, 2, xtnd, trans, trans, trans,
  366.   #endif    BPOP
  367.       "quit", 0, 0, quit, trans, halt, halt,
  368.   
  369. + #ifdef    POP2
  370. +     "helo", 2, 2, helo, auth1, mbox, auth1,
  371. +     "fold", 1, 1, fold, mbox, mbox, mbox,
  372. +     "quit", 0, 0, quit, mbox, halt, halt,
  373. +     "read", 0, 1, rdp2, mbox, item, error,
  374. +     "fold", 1, 1, fold, item, mbox, mbox,
  375. +     "read", 0, 1, rdp2, item, item, error,
  376. +     "quit", 0, 0, quit, item, halt, halt,
  377. +     "retr", 0, 0, retrieve, item, ack, error,
  378. +     "acks", 0, 0, ack2, ack, item, error,
  379. +     "ackd", 0, 0, ack2, ack, item, error,
  380. +     "nack", 0, 0, rdp2, ack, item, error,
  381. +     "quit", 0, 0, NULL, ack, halt, halt,
  382. + #endif    POP2
  383.       NULL
  384.   };
  385.   
  386. ***************
  387. *** 97,102 ****
  388. --- 123,131 ----
  389.   
  390.   /*   */
  391.   
  392. + #ifdef    POP2
  393. + static int pop2 = NOTOK;    /* current pop2 msg, or NOTOK if pop3 */
  394. + #endif    POP2
  395.   #ifdef    DPOP
  396.   static int pop_uid;
  397.   static int pop_gid;
  398. ***************
  399. *** 166,174 ****
  400. --- 195,209 ----
  401.   long    lseek ();
  402.   char   *crypt ();
  403.   
  404. + #ifdef    POPUUMBOX
  405. + #define    MBX_READ    pmbx_read
  406.   static    int    pmbx_read ();
  407.   static    char   *p_copy(), *p_copyin(), *p_nextword();
  408.   static        p_cmatch(), p_isdate(), p_ishead(), p_parse(), any();
  409. + #else
  410. + #define    MBX_READ    mbx_read
  411. + extern    int    mbx_read ();
  412. + #endif
  413.   
  414.   static int    setup(), setupaux(), read_map(), read_file(), pmbx_size();
  415.   static int    quitaux(), quitfile(), respond(), getline();
  416. ***************
  417. *** 311,316 ****
  418. --- 346,360 ----
  419.   }
  420.   
  421.   /*   */
  422. + #ifdef    POP2
  423. + static int  helo (vec)        /* sort of "user" and "pass" */
  424. + register char  **vec;
  425. + {
  426. +     pop2 = 0;                /* now we're talkin' pop2! */
  427. +     make_lower (username, vec[1]);    /* helo user pass */
  428. +     return pass (++vec);        /* user pass */
  429. + }
  430. + #endif
  431.   
  432.   static int  user (vec)
  433.   register char  **vec;
  434. ***************
  435. *** 565,573 ****
  436.       if (setupaux (guest) == NOTOK)
  437.       return NOTOK;
  438.   
  439.       return respond (OK,
  440.           nmsgs ? "maildrop has %d message%s (%d octets)" : "maildrop empty",
  441. !         nmsgs, nmsgs != 1 ? "s" : NULL, Msgs[0].m_size);
  442.   }
  443.   
  444.   /*   */
  445. --- 609,625 ----
  446.       if (setupaux (guest) == NOTOK)
  447.       return NOTOK;
  448.   
  449. + #ifdef    POP2
  450. +     if (pop2 != NOTOK) {        /* in response to pop2 "helo" */
  451. +     pop2 = nmsgs > 0 ? 1 : 0;
  452. +     return respond ('#', "%d message%s (%d octets)",
  453. +         nmsgs, nmsgs != 1 ? "s" : "", Msgs[0].m_size);
  454. +     }
  455. +     else
  456. + #endif    POP2
  457.       return respond (OK,
  458.           nmsgs ? "maildrop has %d message%s (%d octets)" : "maildrop empty",
  459. !         nmsgs, nmsgs != 1 ? "s" : "", Msgs[0].m_size);
  460.   }
  461.   
  462.   /*   */
  463. ***************
  464. *** 682,688 ****
  465.       padvise (NULLCP, LOG_DEBUG, "read_file (%ld, %d)",
  466.           pos, msgp);
  467.   
  468. !     if ((i = pmbx_read (dp, pos, &rp, debug)) <= 0)
  469.       return (msgp - 1);
  470.   
  471.       m_gMsgs ((msgp - 1) + i);
  472. --- 734,740 ----
  473.       padvise (NULLCP, LOG_DEBUG, "read_file (%ld, %d)",
  474.           pos, msgp);
  475.   
  476. !     if ((i = MBX_READ (dp, pos, &rp, debug)) <= 0)
  477.       return (msgp - 1);
  478.   
  479.       m_gMsgs ((msgp - 1) + i);
  480. ***************
  481. *** 753,758 ****
  482. --- 805,884 ----
  483.   }
  484.   
  485.   
  486. + #ifdef    POP2
  487. + static int  rdp2 (vec)        /* always returns OK */
  488. + char  **vec;
  489. + {
  490. +     if (vec[1]) {
  491. +     if ((pop2 = atoi (vec[1])) <= 0)
  492. +         pop2 = 0;
  493. +     }
  494. +     else if (pop2 == 0)
  495. +     return NOTOK;        /* close 'em down */
  496. +     if (pop2 <= 0 || pop2 > nmsgs) {
  497. +     pop2 = 0;
  498. +     return respond ('=', "0 no message"); 
  499. +     }
  500. +     if (Msgs[pop2].m_flags & MDELE) {
  501. +     pop2 = 0;
  502. +     return respond ('=', "0 message %d is deleted", pop2);
  503. +     }
  504. +     return respond ('=', "%d (message %d)", Msgs[pop2].m_size, pop2);
  505. + }
  506. + static int  ack2 (vec)
  507. + char   **vec;
  508. + {
  509. +     if (strcmp (vec[0], "ackd") == 0) {
  510. +     Msgs[pop2].m_flags |= MDELE;    /* ignored later if MREAD */
  511. +     Msgs[0].m_size -= Msgs[pop2].m_size;
  512. +     dmsgs++;
  513. +     }
  514. +     if (pop2) {        /* a current msg */
  515. +     rmsgs++;            /* mark this one as read */
  516. +     if (++pop2 > nmsgs)
  517. +         pop2 = -1;            /* let rdp2 reset */
  518. +     else if (Msgs[pop2].m_flags & MDELE)
  519. +         pop2 = -1;            /* let rdp2 reset */
  520. +     if (pop2 > Msgs[0].m_last)
  521. +         Msgs[0].m_last = pop2;
  522. +     }
  523. +     return rdp2 (vec);        /* vec = { "acks", 0 } */
  524. + }
  525. + static int  fold (vec)
  526. + register char  **vec;
  527. + {
  528. +     pop2 = 0;
  529. + #ifdef    notdef        
  530. + /* This might work, or it might be a huge security hole.  For my purpose,
  531. +  * it doesn't need to work, so I'm not going to make sure it's OK.
  532. +  * 16Nov90/JLR
  533. +  */
  534. +    
  535. +     if (quitaux (NULLVP) == NOTOK)
  536. +     return respond ('#', "0 unable to close folder");
  537. +     
  538. +     (void) sprintf (maildrop, vec[1]);
  539. +     if (setupaux (access (maildrop, 2) ? 1 : 0) == NOTOK)
  540. +     return respond ('#', "0 unable to read %s", maildrop);
  541. +     pop2 = nmsgs > 0 ? 1 : 0;
  542. +     return respond ('#', "%d message%s in %s (%d octets)",
  543. +         nmsgs, nmsgs != 1 ? "s" : "", maildrop, Msgs[0].m_size);
  544. +     
  545. + #endif
  546. +     respond ('#', "0 unable to change folders");
  547. +     return NOTOK;
  548. + }
  549. + #endif    POP2
  550.   static int  list (vec)
  551.   register char  **vec;
  552.   {
  553. ***************
  554. *** 773,779 ****
  555.       }
  556.   
  557.       (void) respond (OK, "%d message%s (%d octets)",
  558. !         nmsgs - dmsgs, nmsgs - dmsgs != 1 ? "s" : NULL,
  559.           Msgs[0].m_size);
  560.       for (i = 1; i <= nmsgs; i++)
  561.       if (!(Msgs[i].m_flags & MDELE))
  562. --- 899,905 ----
  563.       }
  564.   
  565.       (void) respond (OK, "%d message%s (%d octets)",
  566. !         nmsgs - dmsgs, nmsgs - dmsgs != 1 ? "s" : "",
  567.           Msgs[0].m_size);
  568.       for (i = 1; i <= nmsgs; i++)
  569.       if (!(Msgs[i].m_flags & MDELE))
  570. ***************
  571. *** 798,803 ****
  572. --- 924,934 ----
  573.       register char  *cp;
  574.       char    buffer[BUFSIZ];
  575.   
  576. + #ifdef    POP2
  577. +   if (pop2 == 0)
  578. +     return NOTOK;
  579. +   else if (pop2 == NOTOK) {
  580. + #endif
  581.       if ((i = atoi (vec[1])) <= 0 || i > nmsgs)
  582.       return respond (NOTOK, "no such message: \"%s\"", vec[1]);
  583.       if (Msgs[i].m_flags & MDELE)
  584. ***************
  585. *** 804,809 ****
  586. --- 935,945 ----
  587.       return respond (NOTOK, "message %d is deleted", i);
  588.   
  589.       (void) respond (OK, "%d octets", Msgs[i].m_size);
  590. + #ifdef    POP2
  591. +   }
  592. +   else        /* if called by pop2, vec = { "retr", 0 } */
  593. +     i = pop2;
  594. + #endif
  595.   
  596.       for ((void) fseek (dp, pos = Msgs[i].m_start, 0);
  597.           fgets (buffer, sizeof buffer, dp) != NULL && pos < Msgs[i].m_stop;
  598. ***************
  599. *** 812,817 ****
  600. --- 948,956 ----
  601.           *cp = NULL;
  602.       multiline ("%s", buffer);
  603.       }
  604. + #ifdef    POP2
  605. +   if (pop2 == NOTOK) {        /* then multiend */
  606. + #endif
  607.       multiend ();
  608.   
  609.       if (i > Msgs[0].m_last) {
  610. ***************
  611. *** 818,823 ****
  612. --- 957,965 ----
  613.       Msgs[0].m_last = i; 
  614.       rmsgs++;
  615.       }
  616. + #ifdef    POP2
  617. +   }
  618. + #endif
  619.   
  620.       return OK;
  621.   }
  622. ***************
  623. *** 1147,1153 ****
  624.       return respond (OK,
  625.           n ? "%s signing off (%d message%s, %d octets left)"
  626.           : "%s signing off (maildrop empty)",
  627. !         server, n - d, n - d != 1 ? "s" : NULL, Msgs[0].m_size);
  628.   }
  629.   
  630.   
  631. --- 1289,1295 ----
  632.       return respond (OK,
  633.           n ? "%s signing off (%d message%s, %d octets left)"
  634.           : "%s signing off (maildrop empty)",
  635. !         server, n - d, n - d != 1 ? "s" : "", Msgs[0].m_size);
  636.   }
  637.   
  638.   
  639. ***************
  640. *** 1314,1323 ****
  641.       char    buffer[BUFSIZ];
  642.   
  643.       bp = buffer;
  644. !     bp += strlen (sprintf (bp, "%s%s", code == OK ? "+OK" : "-ERR",
  645. !         fmt ? " " : NULL));
  646. !     if (fmt)
  647. !     bp += strlen (sprintf (bp, fmt, a, b, c, d));
  648.       putline (buffer, output);
  649.   
  650.       return code;
  651. --- 1456,1482 ----
  652.       char    buffer[BUFSIZ];
  653.   
  654.       bp = buffer;
  655. ! #ifndef    POP2
  656. !     (void) sprintf (bp, "%s%s", code == OK ? "+OK" : "-ERR", fmt ? " " : "");
  657. !     bp += strlen (bp);
  658. ! #else
  659. !     switch (code) {
  660. !     case OK:
  661. !     case NOTOK:
  662. !         (void) sprintf (bp, "%s%s", code == OK ? "+OK" : "-ERR",
  663. !             fmt ? " " : "");
  664. !         bp += strlen (bp);
  665. !         break;
  666. !     default:        /* only happens in pop2 */
  667. !         *bp++ = code;
  668. !         code = OK;
  669. !     }
  670. ! #endif
  671. !     if (fmt) {
  672. !     (void) sprintf (bp, fmt, a, b, c, d);
  673. !     bp += strlen (bp);
  674. !     }
  675.       putline (buffer, output);
  676.   
  677.       return code;
  678. ***************
  679. *** 1457,1464 ****
  680. --- 1616,1638 ----
  681.    * INET: steved@longs.LANCE.ColoState.Edu, dempsey@handel.CS.ColoState.Edu
  682.    * boulder!ccncsu!longs.LANCE.ColoState.Edu!steved, ...!ncar!handel!dempsey
  683.    */
  684. + /* From:    Jim Reid <jim@computer-science.strathclyde.ac.UK>
  685. +  * 
  686. +  * MH-6.7 does not support MMDF-style mailboxes with POP as claimed. It
  687. +  * appears that when code was added to popser.c to support UNIX-style
  688. +  * mailboxes, the old behaviour was lost. i.e. The new popd worked with
  689. +  * UNIX-style mailboxes, but not MMDF ones. Users would get "format error"
  690. +  * error messages if they tried to inc a remote MMDF-style mailbox because
  691. +  * the pop daemon didn't want to know or like the MMDF message delimiters.
  692. +  */
  693.   
  694. + /* So... Now there's an incredible hack in mhconfig.c to define POPUUMBOX
  695. +  * in support/pop/Makefile if we're using Sendmail.  This causes this
  696. +  * UUCP-mbox reading code to be used here.  Ugh.  05Nov90/JLR
  697. +  */
  698.   /*   */
  699. + #ifdef    POPUUMBOX
  700.   /* from dropsbr.c - read from a mailbox - pop server version */
  701.   
  702.   /* ALMOST IDENTICAL to mbx_read */
  703. ***************
  704. *** 1863,1865 ****
  705. --- 2037,2040 ----
  706.               return(1);
  707.       return(0);
  708.   }
  709. + #endif
  710. *** ../mh-6.7-dist/./sbr/m_sync.c    Thu Apr 12 13:29:03 1990
  711. --- ./sbr/m_sync.c    Mon Nov  5 11:47:29 1990
  712. ***************
  713. *** 1,4 ****
  714. --- 1,7 ----
  715.   /* m_sync.c - synchronize message sequences */
  716. + #ifndef    lint
  717. + static char ident[] = "@(#)$Id: m_sync.c,v 1.6 90/11/05 11:46:34 mh Exp $";
  718. + #endif    lint
  719.   
  720.   #include "../h/mh.h"
  721.   #include <stdio.h>
  722. ***************
  723. *** 60,67 ****
  724.           continue;
  725.           if (fp == NULL) {
  726.           if ((fp = fopen (seq, "w")) == NULL
  727. !             && unlink (seq) != NOTOK 
  728. !             && (fp = fopen (seq, "w")) == NULL) {
  729.               admonish (attr, "unable to write");
  730.               goto priv;
  731.           }
  732. --- 63,70 ----
  733.           continue;
  734.           if (fp == NULL) {
  735.           if ((fp = fopen (seq, "w")) == NULL
  736. !             && (unlink (seq) == NOTOK ||
  737. !                 (fp = fopen (seq, "w")) == NULL)) {
  738.               admonish (attr, "unable to write");
  739.               goto priv;
  740.           }
  741. *** ../mh-6.7-dist/./sbr/addrsbr.c    Thu Apr 12 13:28:50 1990
  742. --- ./sbr/addrsbr.c    Mon Nov  5 12:26:57 1990
  743. ***************
  744. *** 1,4 ****
  745. --- 1,7 ----
  746.   /* addrsbr.c - parse addresses 822-style */
  747. + #ifndef    lint
  748. + static char ident[] = "@(#)$Id: addrsbr.c,v 1.7 90/11/05 12:26:41 mh Exp $";
  749. + #endif    lint
  750.   
  751.   #include "../h/mh.h"
  752.   #include "../h/addrsbr.h"
  753. ***************
  754. *** 830,835 ****
  755. --- 833,840 ----
  756.           }
  757.   #else    not BERK
  758.       for (mp = &mq; mp = mp -> m_next;) {
  759. +     if (np -> m_mbox == NULL)
  760. +         continue;
  761.       if ((len = strlen (cp = np -> m_mbox))
  762.           < (i = strlen (pp = mp -> m_mbox)))
  763.           continue;
  764. ***************
  765. *** 854,859 ****
  766. --- 859,866 ----
  767.   
  768.       if (mp -> m_nohost)
  769.           return 1;
  770. +     if (np -> m_host == NULL)
  771. +         continue;
  772.       if ((len = strlen (cp = np -> m_host))
  773.           < (i = strlen (pp = mp -> m_host)))
  774.           continue;
  775. *** ../mh-6.7-dist/./sbr/m_getfld.c    Thu Apr 12 13:29:01 1990
  776. --- ./sbr/m_getfld.c    Wed Apr 18 13:48:20 1990
  777. ***************
  778. *** 1,4 ****
  779. --- 1,7 ----
  780.   /* m_getfld.c - read/parse a message */
  781. + #ifndef    lint
  782. + static char ident[] = "@(#)$Id: m_getfld.c,v 1.8 90/04/18 13:48:12 sources Exp $";
  783. + #endif    lint
  784.   
  785.   #include "../h/mh.h"
  786.   #include <stdio.h>
  787. ***************
  788. *** 542,550 ****
  789. --- 545,557 ----
  790.            */
  791.           return 1;
  792.   
  793. + #ifdef notdef
  794.       (void) fseek (iob, (long)(pos-1), 0);
  795.       if (iob->_cnt <= 0)
  796.           _filbuf(iob);
  797. + #else
  798. +     (void) fseek (iob, pos, 0);
  799. + #endif /* !notdef */
  800.       return 0;
  801.       }
  802.   
  803. *** ../mh-6.7-dist/./conf/mhconfig.c    Thu Apr 12 13:27:24 1990
  804. --- ./conf/mhconfig.c    Mon Nov  5 16:24:58 1990
  805. ***************
  806. *** 1,7 ****
  807.   /* mhconfig.c - configure MH */
  808.   /* cc [-DSYS5] mhconfig.c -o mhconfig */
  809.   #ifndef    lint
  810. ! static char ident[] = "@(#)$Id: mhconfig.c,v 2.23 90/04/08 10:57:33 sources Exp $";
  811.   #endif    lint
  812.   
  813.   #include <ctype.h>
  814. --- 1,7 ----
  815.   /* mhconfig.c - configure MH */
  816.   /* cc [-DSYS5] mhconfig.c -o mhconfig */
  817.   #ifndef    lint
  818. ! static char ident[] = "@(#)$Id: mhconfig.c,v 2.26 90/11/05 16:24:55 mh Exp $";
  819.   #endif    lint
  820.   
  821.   #include <ctype.h>
  822. ***************
  823. *** 420,425 ****
  824. --- 420,428 ----
  825.           fprintf (fp, "/^@BEGIN: SENDMTSHACK$/,/^@END: SENDMTSHACK$/d\n");
  826.           break;
  827.       }
  828. +     /* special hack for support/pop/popser.c */
  829. +     fprintf (fp, "s%%@(POPUUMBOX)%%%s%%g\n",
  830. +         mtsnum == sendmail ? "-DPOPUUMBOX" : "");
  831.   
  832.       if (bsd43)        /* for sgid(tty)-rcvtty */
  833.       fprintf (fp, "/^@BEGIN: BSD43$/d\n/^@END: BSD43$/d\n");
  834. *** ../mh-6.7-dist/./conf/mh-gen.8    Thu Apr 12 13:27:24 1990
  835. --- ./conf/mh-gen.8    Wed Nov 21 09:58:36 1990
  836. ***************
  837. *** 1,2 ****
  838. ! .\" @(#)$Id: mh-gen.8,v 2.48 90/04/09 13:27:27 sources Exp $
  839.   .\" uneven inter-word spacing (nroff line adjusting) hampers readability
  840. --- 1,2 ----
  841. ! .\" @(#)$Id: mh-gen.8,v 2.50 90/11/21 09:27:52 mh Exp Locker: mh $
  842.   .\" uneven inter-word spacing (nroff line adjusting) hampers readability
  843. ***************
  844. *** 224,225 ****
  845. --- 224,226 ----
  846.   or, \*(lqmh\*(rq to have \fIMH\fR as the transport system.
  847.   On UNIX systems supporting TCP/IP networking via sockets
  848. ***************
  849. *** 229,234 ****
  850.   \fISendMail\fR.
  851. ! The \*(lq/smtp\*(rq suffix is described in detail in the \fIAdministrator's
  852. ! Guide\fR.
  853. ! Hence,
  854. ! for TCP/IP UNIX systems,
  855.   the \*(lq/smtp\*(rq suffix to either \*(lqsendmail\*(rq or \*(lqmmdf2\*(rq is
  856. --- 230,232 ----
  857.   \fISendMail\fR.
  858. ! Hence, for TCP/IP UNIX systems,
  859.   the \*(lq/smtp\*(rq suffix to either \*(lqsendmail\*(rq or \*(lqmmdf2\*(rq is
  860. ***************
  861. *** 235,236 ****
  862. --- 233,237 ----
  863.   the preferred MTS configuration.
  864. + The \*(lq/smtp\*(rq suffix is described in detail in the \fIAdministrator's
  865. + Guide\fR; be sure to set \*(lqservers:\*(rq as described in
  866. + \fImh\-tailor\fR\0(8) if you use this option.
  867.   
  868. ***************
  869. *** 246,248 ****
  870.   If \*(lqpop\*(rq (formerly \*(lqpopbboards:\ on\*(rq),
  871. ! include support for the UCI BBoards facility via the POP service;
  872.   this setting requires \*(lqpop:\ on\*(rq.
  873. --- 247,249 ----
  874.   If \*(lqpop\*(rq (formerly \*(lqpopbboards:\ on\*(rq),
  875. ! include support for the UCI BBoards facility via the POP3 service;
  876.   this setting requires \*(lqpop:\ on\*(rq.
  877. ***************
  878. *** 261,263 ****
  879.   To read remote BBoards,
  880. ! the usual configuration would have \fIbbc\fR talk to a \fIPOP\fR or
  881.   \fINNTP\fR server.
  882. --- 262,264 ----
  883.   To read remote BBoards,
  884. ! the usual configuration would have \fIbbc\fR talk to a \fIPOP3\fR or
  885.   \fINNTP\fR server.
  886. ***************
  887. *** 290,294 ****
  888.   you intend to use POP.)
  889. ! If POP is enabled, there are two additional options which are of interest:
  890. ! \*(lqRPOP\*(rq and \*(lqDPOP\*(rq.
  891. ! The former indicates that support for the UNIX variant of POP,
  892.   RPOP, which uses privileged sockets for authentication be enabled.
  893. --- 291,295 ----
  894.   you intend to use POP.)
  895. ! If POP is enabled, there are three additional options which are of interest:
  896. ! \*(lqRPOP\*(rq, \*(lqDPOP\*(rq and \*(lqPOP2\*(rq.
  897. ! The first indicates that support for the UNIX variant of POP,
  898.   RPOP, which uses privileged sockets for authentication be enabled.
  899. ***************
  900. *** 298,300 ****
  901.   and instead have their own separate database (another major win).
  902. ! Both of these options can be enabled via an \*(lqoptions\*(rq directive in the
  903.   \fIMH\fR configuration file.
  904. --- 299,304 ----
  905.   and instead have their own separate database (another major win).
  906. ! The \*(lqPOP2\*(rq option indicates that the \fIMH\fP POP daemon should
  907. ! speak the older POP2 protocol in addition to the \fIMH\fP POP3 protocol \-
  908. ! a major win.
  909. ! All of these options can be enabled via an \*(lqoptions\*(rq directive in the
  910.   \fIMH\fR configuration file.
  911. ***************
  912. *** 500,501 ****
  913. --- 504,516 ----
  914.   .ti -.5i
  915. + POP2
  916. + .br
  917. + Have the POP daemon understand the older
  918. + POP2 protocol as well as the \fIMH\fP POP3 protocol \- a major win.
  919. + The POP daemon auto-magically
  920. + determines which POP protocol your client is using.
  921. + If you're enabling POP service,
  922. + there's no reason not to enable this option as well.
  923. + See also \fIPOPSERVICE\fR.
  924. + .ti -.5i
  925.   POPSERVICE
  926. ***************
  927. *** 503,507 ****
  928.   The port name the \fIMH\fP POP will use.  For historical reasons,
  929. ! this defaults to \*(lqpop\*(rq.  The \fIMH\fP POP protocol
  930. ! (POP version 3) has finally been assigned its own port number (110),
  931. ! which differs from the original POP (version 1) port number (109).
  932.   To have \fIMH\fP POP use the new assigned port number, 
  933. --- 518,524 ----
  934.   The port name the \fIMH\fP POP will use.  For historical reasons,
  935. ! this defaults to \*(lqpop\*(rq.
  936. ! In 1987, the \fIMH\fP POP protocol
  937. ! (POP version 3) was published as RFC1081 and
  938. ! was assigned its own port number (110),
  939. ! which differs from the original POP (version 1 and 2) port number (109).
  940.   To have \fIMH\fP POP use the new assigned port number, 
  941. ***************
  942. *** 510,511 ****
  943. --- 527,530 ----
  944.   and server hosts as \*(lq110/tcp\*(rq.
  945. + If you enable \fIPOP2\fP, you can safely leave this undefined unless
  946. + you are using POP3 clients besides \fIMH\fP.
  947.   
  948. *** ../mh-6.7-dist/./conf/makefiles/mtsM    Thu Apr 12 13:27:21 1990
  949. --- ./conf/makefiles/mtsM    Mon Nov  5 12:08:17 1990
  950. ***************
  951. *** 4,6 ****
  952.   #    @(MHWARNING)
  953. ! # @(#)$Id: mtsM,v 2.2 90/04/05 15:17:58 sources Exp $
  954.   ##############################################################################
  955. --- 4,6 ----
  956.   #    @(MHWARNING)
  957. ! # @(#)$Id: mtsM,v 2.3 90/04/18 13:47:30 sources Exp $
  958.   ##############################################################################
  959. ***************
  960. *** 51,53 ****
  961.   
  962. ! clean:;        for d in $(DIRS); do (cd $$d; $(MAKE) clean); done
  963.   
  964. --- 51,54 ----
  965.   
  966. ! clean:;        -rm -f $(LIB) $(LLIB)
  967. !         for d in $(DIRS); do (cd $$d; $(MAKE) clean); done
  968.   
  969. *** ../mh-6.7-dist/./conf/makefiles/support/pop    Thu Apr 12 13:27:22 1990
  970. --- ./conf/makefiles/support/pop    Mon Nov  5 16:06:05 1990
  971. ***************
  972. *** 4,6 ****
  973.   #    @(MHWARNING)
  974. ! # @(#)$Id: pop,v 2.5 90/04/05 15:16:16 sources Exp $
  975.   ##############################################################################
  976. --- 4,6 ----
  977.   #    @(MHWARNING)
  978. ! # @(#)$Id: pop,v 2.7 90/11/05 16:06:03 mh Exp $
  979.   ##############################################################################
  980. ***************
  981. *** 11,13 ****
  982.   LIBDIR    =    $(DESTDIR)@(MHETCPATH)
  983. ! OPTIONS    =    @(MHOPTIONS) -I..
  984.   LDOPTIONS=    @(LDOPTIONS)
  985. --- 11,13 ----
  986.   LIBDIR    =    $(DESTDIR)@(MHETCPATH)
  987. ! OPTIONS    =    @(MHOPTIONS) @(POPUUMBOX) -I..
  988.   LDOPTIONS=    @(LDOPTIONS)
  989. *** ../mh-6.7-dist/./conf/examples/uci    Thu Apr 12 13:27:15 1990
  990. --- ./conf/examples/uci    Mon Apr 16 15:49:23 1990
  991. ***************
  992. *** 24,26 ****
  993.   ranlib  on
  994. ! sharedlib on
  995.   slibdir    /usr/local/lib
  996. --- 24,26 ----
  997.   ranlib  on
  998. ! sharedlib off
  999.   slibdir    /usr/local/lib
  1000. *** ../mh-6.7-dist/./conf/doc/mh-mts.rf    Thu Apr 12 13:27:09 1990
  1001. --- ./conf/doc/mh-mts.rf    Wed Nov 21 10:09:34 1990
  1002. ***************
  1003. *** 1,3 ****
  1004.   .\"    @(MHWARNING)
  1005. ! .\" @(#)$Id: mh-mts.rf,v 1.6 90/04/05 15:08:37 sources Exp $
  1006.   .SC MH\-MTS 8
  1007. --- 1,3 ----
  1008.   .\"    @(MHWARNING)
  1009. ! .\" @(#)$Id: mh-mts.rf,v 1.7 90/11/21 10:09:32 mh Exp $
  1010.   .SC MH\-MTS 8
  1011. ***************
  1012. *** 55,56 ****
  1013. --- 55,58 ----
  1014.   this approach can be tolerant of faults.
  1015. + Be sure to set \*(lqservers:\*(rq as described in
  1016. + mh\-tailor(8) if you use this option.
  1017.   
  1018. *** ../mh-6.7-dist/./conf/config/mts.c    Thu Apr 12 13:27:04 1990
  1019. --- ./conf/config/mts.c    Mon Nov  5 12:06:51 1990
  1020. ***************
  1021. *** 1,4 ****
  1022. --- 1,7 ----
  1023.   /* mts.c - definitions for the mail transport system */
  1024. + #ifndef    lint
  1025. + static char ident[] = "@(#)$Id: mts.c,v 2.6 90/11/05 12:06:39 mh Exp $";
  1026. + #endif    lint
  1027.   
  1028.   /* LINTLIBRARY */
  1029.   
  1030. ***************
  1031. *** 485,498 ****
  1032.           continue;
  1033.       *cp = NULL;
  1034.       }
  1035. -     /*
  1036. -      *  If the fullname contains any .'s, quote it
  1037. -      */
  1038. -     if (index(fullname, '.')) {
  1039. -       char tmp[BUFSIZ];
  1040. -       sprintf (tmp, "\"%s\"", fullname);
  1041. -       strcpy (fullname, tmp);
  1042. -     }
  1043.       if (MMailids == 0 || *np == NULL) {
  1044.       (void) strcpy (username, pw -> pw_name);
  1045.       fullname[0] = NULL;
  1046. --- 488,493 ----
  1047. ***************
  1048. *** 499,504 ****
  1049. --- 494,504 ----
  1050.       }
  1051.       if ((cp = getenv ("SIGNATURE")) && *cp)
  1052.       (void) strcpy (fullname, cp);
  1053. +     if (index(fullname, '.')) {        /*  quote any .'s */
  1054. +       char tmp[BUFSIZ];
  1055. +       sprintf (tmp, "\"%s\"", fullname);
  1056. +       strcpy (fullname, tmp);
  1057. +     }
  1058.   
  1059.       return username;
  1060.   }
  1061.